<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=8">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta content="B2B电商平台" name="description" />
<meta content="B2B电商平台" name="keyword" />

<title>B2B电商平台.分销审核</title>
<link rel="icon" href="include/images/icss.ico" type="image/x-icon" />
<link rel="shortcut icon" href="include/images/icss.ico"
	type="image/x-icon" />
<link rel="stylesheet" type="text/css"
	href="<%=path %>/include/css/global.css" />
<link rel="stylesheet" type="text/css"
	href="<%=path %>/include/css/style.css" />
<link rel="stylesheet" type="text/css"
	href="<%=path %>/include/css/pro.css" />
<link rel="stylesheet" type="text/css"
	href="<%=path %>/include/css/proManage.css" />
<link rel="stylesheet" type="text/css"
	href="<%=path %>/include/css/mmt_trading.css" />

<link rel="stylesheet"
	href="<%=path %>/include/JQuery ui/css/smoothness/jquery-ui-1.7.3.custom.css"
	type="text/css"></link>
<link rel="stylesheet" type="text/css"
	href="<%=path%>/include/pagination/page.css" media="all">
<script type="text/javascript"
	src="<%=path %>/include/js/jquery-1.8.0.min.js"></script>
<script type="text/javascript" src="<%=path %>/include/js/cookies.js"></script>
<script type="text/javascript" src="<%=path %>/include/js/icss.busin.js"></script>
<script type="text/javascript"
	src="<%=path %>/include/JQuery ui/js/jquery-ui-1.7.3.custom.min.js"></script>
<script type="text/javascript"
	src="<%=path %>/include/js/icss.common.js"></script>
<script type="text/javascript"
	src="<%=path%>/include/pagination/jquery.pagination.js"></script>
<script type="text/javascript"
	src="<%=path%>/include/pagination/init.js"></script>
<script type="text/javascript" src="<%=path%>/include/layer/layer.js"></script>
<link href="<%=path %>/include/DatePicker/skin/WdatePicker.css"
	rel="stylesheet" type="text/css">
<script src="<%=path %>/include/DatePicker/WdatePicker.js"
	charset="UTF-8" type="text/javascript"></script>
<style type="text/css">
.price a.price_rise {
	background-position: -62px -126px;
}

.price a.price_drop {
	background-position: -62px -86px;
}

.price a.price_null {
	background-position: -1px -280px;
	padding-right: 0px;
}

.expire a.expire_drops {
	background-position: -61px -93px;
}

.expire a.expire_rise {
	background-position: -61px -134px;
}

.expire a.expire_null {
	background-position: -61px -15px;
	padding-right: 0px;
}

thead th {
	border: 1px solid #ddd;
	font-weight: bold;
}

#userShareStatisList a {
	text-decoration: none;
}

#userShareStatisList td {
	padding: 4px 4px;
	border: 1px solid #ddd;
}

#lie th {
	border: 1px solid #ddd;
}

.search_lis_se input {
	height: 24px;
}

.save {
	width: 44px;
	height: 24px;
	line-height: 24px;
	background-color: transparent;
	background-repeat: no-repeat;
	background-position: 0 -203px;
	border: 0;
	cursor: pointer;
	font: 12px/1.5 arial, tahoma, \5b8b\4f53;
	margin: 0 0 0 5px;
	outline: none;
	background-image: url('<%=path%>/include/css/img/xs_bgx.png');
}

button {
	width: 44px;
	height: 24px;
	line-height: 24px;
	background-color: transparent;
	background-repeat: no-repeat;
	background-position: 0 -203px;
	border: 0;
	cursor: pointer;
	font: 12px/1.5 arial, tahoma, \5b8b\4f53;
	margin: 0 0 0 5px;
	outline: none;
	background-image: url('<%=path%>/include/css/img/xs_bgx.png');
}

th {
	text-align: center;
	vertical-align: middle
}
</style>


<script type="text/javascript">
	$(document).ready(function() {
		_queryList();
	});
	
    var pagination;
    //查询详情列表
	function _queryList(){
		var userCode  = $("#userCode").val();
		var frmStartTime = $("#frmStartTime").val();
	    var frmEndTime = $("#frmEndTime").val();
	    if(frmStartTime>frmEndTime){
		    if(frmEndTime !=null&&frmEndTime !=""&&frmEndTime !="undefined"){
		    	parent.swal("开始时间不可以大于结束时间!");
		    	return;
		    }
		}  
		var url = "<%=path %>/userShare/queryStatisticsPage.do?userCode=" +userCode+ "&frmStartTime=" +frmStartTime+ "&frmEndTime=" +frmEndTime;
  		pagination = _initPagination({'pageId':'pagination', 'cKey':'','url': url, 'rows': 10, 'callback':_initDataList});
	}
	function _initDataList(data) {
	 		var d = data.rows;
	 		var total = data.total;
			var str = "";
			$("#userShareStatisList").empty();
			for(var i=0;i<d.length;i++){
				str += "<tr>";
				str += "    <td class='t1' style='text-align:center;vertical-align: middle'> " + (i+1);
				str += "    </td>";
				str += "    <td class='t2' style='text-align:center;vertical-align: middle'>"+d[i].conName;
				str += "	</td>";
				str +="		<td class='t2' style='text-align:center;vertical-align: middle'>"+d[i].orderNo;
				str +="		</td>";
				str +="		<td class='t4' style='text-align:left;vertical-align: middle'>"+d[i].address;
				str +="		</td>";
				str +="		<td class='t2' style='text-align:center;vertical-align: middle'>"+d[i].conTel;
				str +="		</td>";
				str +="		<td class='t3' style='text-align:center;vertical-align: middle'>"+d[i].createTime;
				str +="		</td>";
				str +="		<td class='t3' style='text-align:center;vertical-align: middle'>"+d[i].productName;
				str +="		</td>";
				str +="		<td class='t2' style='text-align:center;vertical-align: middle'>"+d[i].sellAmountBook;
				str +="		</td>";
				str +="		<td class='t2' style='text-align:center;vertical-align: middle'>"+d[i].realMoney;
				str +="		</td>";
				str +="		<td class='t2' style='text-align:center;vertical-align: middle'>"+d[i].deliverMoney;
				str +="		</td>";
				str +="		<td class='t2' style='text-align:center;vertical-align: middle'>"+d[i].sumRealMoney;
				str +="		</td>";
				str +=" </tr>";
			}
			$("#userShareStatisList").append(str);
			
			setTimeout(function(){_reHeight("rightFrame","contentDiv");},1000);
			
	 }
	 //进入统计导出所有数据
	 function exportData() {
		 var userCode  = $("#userCode").val();
		 var frmStartTime = $("#frmStartTime").val();
		 var frmEndTime = $("#frmEndTime").val();
		 window.location.href ="<%=path%>/userShare/exportStatistics.do?userCode="+userCode+"&frmStartTime=" +frmStartTime+ "&frmEndTime=" +frmEndTime;
	 }
</script>
</head>
<body>
	<div id="contentDiv"
		style="padding: 4px; width: 99%; font-family: '微软雅黑';">
		<input type="hidden" id="userCode" name="userCode" value="${userCode}" /> 
		<div class="colnums-2-ab-b" style="overflow-x: auto;">
			<div class="toptil">用户分销列表</div>
			<div class="search_lis" style="border: 1px solid #e0e0e0; background: #f5f5f5; padding-left: 10px; margin-bottom: 10px; width: 98.5%; height: 30px;">
				<div class="search_lis_se" style="font-size: 14px;">
					<span style="margin-left: 5px;">购买时间: </span> <input type="text"
						id="frmStartTime" name="frmStartTime"
						onclick="WdatePicker({dateFmt:'yyyy-MM-dd',readOnly:true,maxDate:'#F{$dp.$D(\'frmEndTime\')}'})"
						style="width: 110px; height: 24px; padding-left: 3px"
						onfocus="WdatePicker({position:{left:315,top:88}})" class="Wdate"
						value="" realvalue=""> <span style="margin-left: 5px;">至</span>
					<input type="text" id="frmEndTime" name="frmEndTime"
						onclick="WdatePicker({dateFmt:'yyyy-MM-dd',readOnly:true,minDate:'#F{$dp.$D(\'frmStartTime\')}'})"
						style="width: 110px; height: 24px; padding-left: 3px; margin-right: 2px;"
						onfocus="WdatePicker({position:{left:464,top:88}})" class="Wdate"
						value="" realvalue="">
					<button type="button" class="save" onclick="_queryList()">查询</button>
					<button type="button"
						style="width: 55px; height: 24px; background-size: 150px 458px;"
						onclick="javascript:exportData()">导出</button>
				</div>
				<div class="wantBuy" id="caigouInfo"></div>
			</div>
			<div class="listed_tb_k" style="width: 99.65%; border: none;">
				<table cellspacing="0" cellpadding="0">
					<thead>
						<tr id="lie">
							<th class="t1">序号</th>
							<th class="t2">订户姓名</th>
							<th class="t2">支付单号</th>
							<th class="t4">地址</th>
							<th class="t2">电话</th>
							<th class="t3">订购日期</th>
							<th class="t3">商品名称</th>
							<th class="t2">销售数量</th>
							<th class="t2">商品金额（元）</th>
							<th class="t2">运费（元）</th>
							<th class="t2">订单总额（元）</th>
						</tr>
					</thead>
					<tbody id="userShareStatisList">
					</tbody>
				</table>
				<div id="pagination"></div>
			</div>
		</div>
		<div class="clear"></div>
	</div>
</body>
<script type="text/javascript">
	$(document).ready(function() {
		_reHeight("rightFrame", "contentDiv");
	});
</script>
</html>
